using FileManager.ViewModels;
using System.Windows;

namespace FileManager.Views
{
    public partial class SettingsWindow : Window
    {
        public SettingsWindow()
        {
            InitializeComponent();
        }

        public SettingsWindow(SettingsViewModel viewModel) : this()
        {
            DataContext = viewModel;

            // 注册关闭事件
            if (viewModel is SettingsViewModel settingsViewModel)
            {
                settingsViewModel.CloseRequested += (s, e) => Close();
            }
        }
    }
}